import request from '@/utils/request'

// 获取目录数据
export function getCatalogList() {
  return request({
    url: '/resource/catalog/tree',
    method: 'get',
  })
}

export function getTreeStruct() {
  return request({
    url: '/resource/catalog/treeStruct',
    method: 'get',
  })
}


export function addCatalog(data) {
  return request({
    url: '/resource/catalog/save',
    method: 'post',
    data
  })
}

export function getCatalogInfo(catId) {
  return request({
    url: `/resource/catalog/info/${catId}`,
    method: 'get'
  })
}

export function updateCatalog(data) {
  return request({
    url: '/resource/catalog/edit',
    method: 'put',
    data
  })
}

export function deleteCatalog(catId) {
  return request({
    url: `/resource/catalog/delete/${catId}`,
    method: 'delete',
  })
}

